//
//  YJWRecommendCategoryCell.m
//  百思不得骑姐
//
//  Created by YJW on 16/10/18.
//  Copyright © 2016年 yijiang. All rights reserved.
//

#import "YJWRecommendCategoryCell.h"
#import "YJWCategory.h"

@interface YJWRecommendCategoryCell ()

@property (weak, nonatomic) IBOutlet UIView *leftView;

@end

@implementation YJWRecommendCategoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.backgroundColor = YJWRGBColor(244, 244, 244);
    self.leftView.backgroundColor = YJWRGBColor(216, 21, 26);
    
}


-(void)setCategory:(YJWCategory *)category{
    _category = category;
    
    self.textLabel.text = category.name;
}

-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    self.textLabel.y = 2;
    
    self.textLabel.height = self.contentView.height - 2 * self.textLabel.y;
}

//选中时候 cell 的设置
-(void)setSelected:(BOOL)selected animated:(BOOL)animated{
    
    self.leftView.hidden = !selected;
    
    self.textLabel.textColor = selected?self.leftView.backgroundColor:YJWRGBColor(56, 56, 56);
}

@end
